package behavioral_pattern.strategy_pattern;

/**
 * 策略模式
 * 定义一些列算法类，将每一个算法封装起来，并让他们可以互相替换。
 *
 */
public class MainStrategy {
    public static void main(String[] args) {
        MovieTicket movieTicket = new MovieTicket();
        double money = 50;
        System.out.println("原价："+money);
        movieTicket.setPrice(50);

        StudentDiscount discount = new StudentDiscount();
        movieTicket.setDiscount(discount);
        System.out.println(movieTicket.getPrice());



    }
}
